package com.gjzhao.fmmall.controller;

import com.gjzhao.fmmall.service.TestService;
import com.gjzhao.fmmall.vo.RespResultVO;
import com.gjzhao.fmmall.vo.ResponseResultVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: 测算 Controller
 * @Author: gjzhao
 * @Date Created in 2022-01-30 12:35 下午
 */
@RestController
@RequestMapping(value = "/test")
@Api(value = "测算数据接口", tags = "测试管理")
@CrossOrigin
public class TestController extends BaseController {

    @Autowired
    private TestService testService;


    @GetMapping("/testRedissonMasterAndSlave")
    @ApiOperation(value = "测试redisson主从模式下使用分布式锁")
    @ApiImplicitParam(value = "分布式锁key", name = "key", dataType = "string", required = true)
    public RespResultVO testRedissonMasterAndSlave(@RequestParam("key") String key) {

        return testService.testRedissonMasterAndSlave(key);

    }

}
